﻿using System;
using Microsoft.Xna.Framework.Audio;
using Terraria.Utilities;

namespace Terraria.Audio
{
	// Token: 0x0200049E RID: 1182
	public abstract class SoundStyle
	{
		// Token: 0x170002D3 RID: 723
		// (get) Token: 0x0600279E RID: 10142 RVA: 0x0001BC97 File Offset: 0x00019E97
		public float Volume
		{
			get
			{
				return this._volume;
			}
		}

		// Token: 0x170002D4 RID: 724
		// (get) Token: 0x0600279F RID: 10143 RVA: 0x0001BC9F File Offset: 0x00019E9F
		public float PitchVariance
		{
			get
			{
				return this._pitchVariance;
			}
		}

		// Token: 0x170002D5 RID: 725
		// (get) Token: 0x060027A0 RID: 10144 RVA: 0x0001BCA7 File Offset: 0x00019EA7
		public SoundType Type
		{
			get
			{
				return this._type;
			}
		}

		// Token: 0x170002D6 RID: 726
		// (get) Token: 0x060027A1 RID: 10145
		public abstract bool IsTrackable { get; }

		// Token: 0x060027A2 RID: 10146 RVA: 0x0001BCAF File Offset: 0x00019EAF
		public SoundStyle(float volume, float pitchVariance, SoundType type = SoundType.Sound)
		{
			this._volume = volume;
			this._pitchVariance = pitchVariance;
			this._type = type;
		}

		// Token: 0x060027A3 RID: 10147 RVA: 0x0001BCCC File Offset: 0x00019ECC
		public SoundStyle(SoundType type = SoundType.Sound)
		{
			this._volume = 1f;
			this._pitchVariance = 0f;
			this._type = type;
		}

		// Token: 0x060027A4 RID: 10148 RVA: 0x0001BCF1 File Offset: 0x00019EF1
		public float GetRandomPitch()
		{
			return SoundStyle._random.NextFloat() * this.PitchVariance - this.PitchVariance * 0.5f;
		}

		// Token: 0x060027A5 RID: 10149
		public abstract SoundEffect GetRandomSound();

		// Token: 0x040043D2 RID: 17362
		private static UnifiedRandom _random = new UnifiedRandom();

		// Token: 0x040043D3 RID: 17363
		private float _volume;

		// Token: 0x040043D4 RID: 17364
		private float _pitchVariance;

		// Token: 0x040043D5 RID: 17365
		private SoundType _type;
	}
}
